package com.example.message2;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class SingleMenuItemActivity  extends Activity {

	// XML node keys
	static final String KEY_NAME = "from";
	static final String KEY_COST = "to";
	static final String KEY_DESC = "text";
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.single_list_item);

		// getting intent data
		Intent in = getIntent();

		// Get XML values from previous intent
		String from = in.getStringExtra(KEY_NAME);
		String to = in.getStringExtra(KEY_COST);
		String text = in.getStringExtra(KEY_DESC);

		// Displaying all values on the screen
		TextView lblName = (TextView) findViewById(R.id.name_label);
		//TextView lblCost = (TextView) findViewById(R.id.cost_label);
		TextView lblDesc = (TextView) findViewById(R.id.description_label);

		lblName.setText(from);
		//lblCost.setText(to);
		lblDesc.setText(text);


		findViewById(R.id.cancelBtn).setOnClickListener(
				new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						close();}
				});

	}
	public void close(){
		this.finish();
	}
}
